#include <iostream>
#include <vector>
using namespace std;
vector<double> niudun(vector<double> x, vector<double> y);
double slution(vector<double> x, vector<double> temp, double cs);
int main()
{
    vector<double> x;
    vector<double> y;
    vector<double> res;
    int n;
    cin>>n;
    for(int i = 0;i<n;i++)
    {
        double numx,numy;
        cin>>numx>>numy;
        x.push_back(numx);
        y.push_back(numy);
    }
    res = niudun(x,y);
    for(int i = 0;i<res.size();i++)
    {
        cout<<res[i]<<endl;

    }
    double cs = 0.596;
    double result = slution(x,res,cs);
    cout<<"结果为"<< result<<endl;
 }
 vector<double> niudun(vector<double> x, vector<double> y)
 {
     vector<double> temp;
     for(int i =1;i<=x.size();i++)
     {
         cout<<"debug1"<<endl;
         for(int j = x.size();j>=i;j--)
         {
             y[j] = (y[j]-y[j-1]) / (x[j] - x[j-i]);
             cout<<"差商为"<<y[j]<<endl;
         }
     }
     cout<<"debug2"<<endl;
     for(int i = 0;i<x.size();i++)
     {
         temp[i] = y[i];
     }
     return temp;
 }
 double slution(vector<double> x,vector<double> temp,double cs)
 {
     int size = temp.size() - 1;
     double p = temp[size];
     for(int i = size;i>=0;i--)
     {
      p = p * (cs - x[i]) + temp[i];
      cout<<p<<endl;
     }
      return p;
 }